<template>
	<view class="cont" @click="onDetail(data.id, data.price)">
		<view class="text-lg text-cut margin-bottom-xs">{{data.title}}</view>
		<view class="margin-bottom-xs flex justify-between align-center">
			<text 
				v-if="data.vip == 0" 
				class="text-lg text-bold" 
				style="color: #FC4E11;">价格：￥{{ data.price }}</text>
				
			<text 
				v-else 
				class="text-lg text-bold" 
				style="color: #FC4E11;">会员价格：￥{{ data.price }}</text>
				
			<text v-if="data.status == 0" class="text-df text-red">验券中</text>
		</view>
		<view class="flex justify-between align-center">
			<text class="text-sm text-gray">{{data.created_at}}</text>
			<block v-if="data.status == 0">
				<button class="cu-btn bg-green shadow-blur round">撤销</button>
			</block>
			<block v-if="data.status == -1">
				<text class="text-df text-red">审核未通过</text>
			</block>
			<block v-if="data.status == 1 || data.status == 3">
				<text class="text-df text-green">交易中</text>
			</block>
			<block v-if="data.status == 4">
				<text class="text-df text-gray">交易完成</text>
			</block>
			<block v-if="data.status == 5">
				<text class="text-df text-orange">售后处理中</text>
			</block>
		</view>	
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object
			},
			vip: {
				type: String
			}
		},
		computed: {
			data() {
				if(this.$props.item) {
					let obj = this.$props.item
					if(obj.vip == 1) {
						obj.price = (Number(obj.bid_price) + Number(obj.vip_price)).toFixed(2)
					} else {
						obj.price = obj.bid_price
					}
					return obj
				}
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			onDetail(id, price) {
				let url = `/pages/Deal/Detail/Detail?id=${id}&price=${price}`
				this.onGoNext(url)
			}
		}
	}
</script>

<style lang="scss">
.cont{
		margin: 0 30rpx;
		margin-top: 30rpx;
		padding: 30rpx 40rpx;
		background-color: #fff;
		border-radius: 12rpx;
		box-shadow: 6rpx 6rpx 8rpx rgba(#000, .01);
		.cu-btn{
			min-width: 164rpx;
			height: 58rpx;
			line-height: 58rpx;
		}
	}
</style>
